package cn.ybk.basic.util;

import lombok.Data;



@Data
public class AjaxResult {

    private boolean success;

    private String msg;

    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult success(){
        return me().setSuccess(true).setMsg("操作成功");
    }

    public AjaxResult msg(){
        return me().setSuccess(false).setMsg("操作失败");
    }

    public AjaxResult msg(String msg){
        return me().setSuccess(false).setMsg(msg);
    }

    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }
}
